package com.nmf.dao.gen;

import com.nmf.dao.gen.bean.BizSysRole;
import com.nmf.dao.gen.bean.BizSysRoleExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface BizSysRoleMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role
     */
    @SelectProvider(type=BizSysRoleSqlProvider.class, method="countByExample")
    long countByExample(BizSysRoleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role
     */
    @DeleteProvider(type=BizSysRoleSqlProvider.class, method="deleteByExample")
    int deleteByExample(BizSysRoleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role
     */
    @Delete({
        "delete from sys_role",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role
     */
    @Insert({
        "insert into sys_role (id, office_id, ",
        "name, enname, role_type, ",
        "data_scope, is_sys, useable, ",
        "create_by, create_date, ",
        "update_by, update_date, ",
        "remarks, del_flag)",
        "values (#{id,jdbcType=VARCHAR}, #{officeId,jdbcType=VARCHAR}, ",
        "#{name,jdbcType=VARCHAR}, #{enname,jdbcType=VARCHAR}, #{roleType,jdbcType=VARCHAR}, ",
        "#{dataScope,jdbcType=CHAR}, #{isSys,jdbcType=VARCHAR}, #{useable,jdbcType=VARCHAR}, ",
        "#{createBy,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, ",
        "#{updateBy,jdbcType=VARCHAR}, #{updateDate,jdbcType=TIMESTAMP}, ",
        "#{remarks,jdbcType=VARCHAR}, #{delFlag,jdbcType=CHAR})"
    })
    int insert(BizSysRole record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role
     */
    @InsertProvider(type=BizSysRoleSqlProvider.class, method="insertSelective")
    int insertSelective(BizSysRole record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role
     */
    @SelectProvider(type=BizSysRoleSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="office_id", property="officeId", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="enname", property="enname", jdbcType=JdbcType.VARCHAR),
        @Result(column="role_type", property="roleType", jdbcType=JdbcType.VARCHAR),
        @Result(column="data_scope", property="dataScope", jdbcType=JdbcType.CHAR),
        @Result(column="is_sys", property="isSys", jdbcType=JdbcType.VARCHAR),
        @Result(column="useable", property="useable", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.VARCHAR),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    List<BizSysRole> selectByExample(BizSysRoleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role
     */
    @Select({
        "select",
        "id, office_id, name, enname, role_type, data_scope, is_sys, useable, create_by, ",
        "create_date, update_by, update_date, remarks, del_flag",
        "from sys_role",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="office_id", property="officeId", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="enname", property="enname", jdbcType=JdbcType.VARCHAR),
        @Result(column="role_type", property="roleType", jdbcType=JdbcType.VARCHAR),
        @Result(column="data_scope", property="dataScope", jdbcType=JdbcType.CHAR),
        @Result(column="is_sys", property="isSys", jdbcType=JdbcType.VARCHAR),
        @Result(column="useable", property="useable", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.VARCHAR),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    BizSysRole selectByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role
     */
    @UpdateProvider(type=BizSysRoleSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BizSysRole record, @Param("example") BizSysRoleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role
     */
    @UpdateProvider(type=BizSysRoleSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BizSysRole record, @Param("example") BizSysRoleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role
     */
    @UpdateProvider(type=BizSysRoleSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BizSysRole record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role
     */
    @Update({
        "update sys_role",
        "set office_id = #{officeId,jdbcType=VARCHAR},",
          "name = #{name,jdbcType=VARCHAR},",
          "enname = #{enname,jdbcType=VARCHAR},",
          "role_type = #{roleType,jdbcType=VARCHAR},",
          "data_scope = #{dataScope,jdbcType=CHAR},",
          "is_sys = #{isSys,jdbcType=VARCHAR},",
          "useable = #{useable,jdbcType=VARCHAR},",
          "create_by = #{createBy,jdbcType=VARCHAR},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "update_by = #{updateBy,jdbcType=VARCHAR},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP},",
          "remarks = #{remarks,jdbcType=VARCHAR},",
          "del_flag = #{delFlag,jdbcType=CHAR}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(BizSysRole record);
}